package com.example.selenium;

import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import java.io.IOException;

/**
 * @className: Main
 * @author: 芃
 * @description: Selenium测试
 * @date: 2025/3/18 13:12
 */
public class Main {

    public static void main(String[] args) throws InterruptedException {
        Test03 test = new Test03();
        //test.test01();
        test.test02();
    }
    public static void main3(String[] args) throws InterruptedException, IOException {
        Test02 test = new Test02();
        //test.test01();
        //test.test02();
        //test.test03();
        //test.test04();
        //test.test05();
        test.test06();
    }

    public static void main2(String[] args) throws InterruptedException {
        Test01 test = new Test01();
        test.test3();
        //test.test4();
        //test.test5();
    }

    public static void main1(String[] args) throws InterruptedException {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        WebDriver driver = new ChromeDriver(options);
        driver.get("https://www.baidu.com");


        //3、找到输入框，并输入搜索关键词：迪丽热巴
        driver.findElement(By.cssSelector("#kw")).sendKeys("迪丽热巴");
        Thread.sleep(3000);
        //4、点击搜索按钮
        driver.findElement(By.cssSelector("#su")).click();
        Thread.sleep(3000);
        //5、获取搜索结果
        driver.quit();
    }

}
